package com.gamejelly.broker.message;

import com.gamejelly.broker.client.BrokerClient;
import lombok.Setter;

@Setter
public class RpcResponse {

    RpcMessage rpcMessage;

    BrokerClient client;

    public CmdInfo getCmdInfo() {
        return rpcMessage.cmdInfo;
    }

    public byte[] getData() {
        return rpcMessage.getData();
    }

    public void reply(Object data) {
        if (data==null){
            return;
        }
        try {
            client.reply(rpcMessage, data);
        } catch (Exception ignored) {
        }
    }
}
